import { createRouter, createWebHistory } from 'vue-router'
import MainView from '@/views/MainView.vue'

const routes = [
  {
    path: '/login',
    name: 'login',
    component: function () {
      return import( '@/views/LoginView.vue')
    }
  },
  {
    path: '/',
    name: 'MainView',
    component: MainView,
    redirect: '/schoolET/adminDetail',
    children: [
      {
        path: '/schoolET/admin2List',
        component: import( '@/views/MainViewPage/Admin2List.vue'),
      },
      {
        path:'/schoolET/addrMana',
        component: import( '@/views/MainViewPage/AddrMana.vue'),
      },
      {
        path:'/schoolET/typeList',
        component: import('@/views/MainViewPage/TypeList.vue')
      },{
        path:'/schoolET/newsPage',
        component: import('@/views/MainViewPage/NewsPage.vue')
      },
      {
        path:'/schoolET/adminDetail',
        component: import('@/views/MainViewPage/AdminDetail.vue')
      },
      {
        path:'/schoolET/goodsPage',
        component: import('@/views/MainViewPage/GoodsPage.vue')
      },
      {
        path:'/schoolET/userPage',
        component: import('@/views/MainViewPage/UserPage.vue')
      },{
        path:'/schoolET/flowPage',
        component: import('@/views/MainViewPage/FlowPage.vue')
      }
    ] 
  }
  // {
  //   path: '/',
  //   name: 'home',
  //   component: HomeView
  // },
  // {
  //   path: '/about',
  //   name: 'about',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: function () {
  //     return import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  //   }
  // }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
